package com.wang.service;

import com.wang.dao.BookMapper;
import com.wang.entity.Books;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 愿青春不负梦想
 * @Description: TODO
 * @email 3062827964@qq.com
 * @date 2023-01-20 18:21
 */
@Service
public class BookServiceImpl implements BookService {

    private BookMapper bookMapper;

    @Override
    public int addBook(Books books) {
        return bookMapper.addBook(books);
    }

    @Override
    public int deleteBookById(int id) {
        return bookMapper.deleteBookById(id);
    }

    @Override
    public int updateBook(Books books) {
        return bookMapper.updateBook(books);
    }

    @Override
    public Books queryBookById(int id) {
        return bookMapper.queryBookById(id);
    }

    @Override
    public List<Books> queryAllBook() {
        return bookMapper.queryAllBook();
    }

    public void setBookMapper(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }
}
